package org.artifact.core.plugin.rmi;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.rmi.server.RMISocketFactory;

public class SMRMISocket extends RMISocketFactory {  
	private int serverPort;
	
    public SMRMISocket(int serverPort) {
		super();
		this.serverPort = serverPort;
	}
	public Socket createSocket(String host, int port)   
        throws IOException{  
        return new Socket(host,port);  
    }  
    public ServerSocket createServerSocket(int port)   
        throws IOException {  
        if (port == 0)  
            port = serverPort;
        
        return new ServerSocket(port);  
    }  
}   